<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>

    var x = 99;
    try { //在try语句种 识别是否错误
      console.log(x)
    } catch (err) {//try语句内部发生错误执行 catch语句
      console.log(err)
      console.log("由于x为定义，执行catch内部的内容")
      let x = 88;
      console.log(x)
    } finally {//总是执行的内容
      console.log("你的操作已完成")
    }

  </script>
</body>

</html>